package controller.admin.employee;

import jakarta.servlet.ServletException;
import jakarta.servlet.annotation.WebServlet;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import model.VO.EmployeePageVO;
import service.Impl.EmployeeServiceImpl;
import util.ResultUtil;

import java.io.IOException;
@WebServlet("/admin/employee/page")
public class EmployeePageController extends HttpServlet {
    //员工分页查询
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        String PAGE=req.getParameter("page");
        String PAGESIZE=req.getParameter("pageSize");
        int page=Integer.parseInt(PAGE);
        int pageSize=Integer.parseInt(PAGESIZE);
        EmployeeServiceImpl e=new EmployeeServiceImpl();
        EmployeePageVO pageVO=e.Page(page,pageSize);

        String json= ResultUtil.getJSON(pageVO);
        resp.getWriter().write(json);
    }
}
